package com.ruoyi.system.controller;

import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.SysBusiness;
import com.ruoyi.system.domain.SysBusinessFinance;
import com.ruoyi.system.service.ISysBusinessFinanceService;
import com.ruoyi.system.service.ISysBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 商家财务Controller
 * 
 * @author ruoyi
 * @date 2024-04-06
 */

@Api(tags = "商家财务管理")
@RestController
@RequestMapping("/bus/finance")
public class BusBusinessFinanceController extends BaseController
{
    @Autowired
    private ISysBusinessFinanceService sysBusinessFinanceService;
    @Autowired
    private ISysBusinessService sysBusinessService;
    /**
     * 获取商家财务详细信息
     */
    @ApiOperation(value = "商家财务详情")
    @GetMapping(value = "/info")
    public AjaxResult getInfo() throws Exception {
        SysBusiness bu = sysBusinessService.getUserInfo();
        if(bu==null){
            throw new Exception("用户未登陆");
        }

        return success(sysBusinessFinanceService.selectSysBusinessFinanceByBusinessId(bu.getId()));
    }

}
